<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>回调地狱</title>
</head>
<body>
    
</body>
<script>
    //回调地狱 当回调函数互相嵌套，嵌套层级过多，导致代码维护性变差，这种解构我们叫作回调地狱
    function ajax(url,sucesscb,errorcb){
        setTimeout(()=>{
            sucesscb('1111')
        },1000)
    }

    //回调地狱
    ajax('/aaa',(data)=>{
        console.log(data);
        ajax('/bbb',(data)=>{
            console.log(data);
            ajax('/ccc',()=>{
                
            },()=>{})
        },()=>{})
    },()=>{})
</script>
</html>